#ifndef _FUNCTION_H_
#define _FUNCTION_H_

#pragma warning(disable:4786)

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

#define DELIM		'_'
#define TEXT_LENGTH	6

static const char * ERR_INVALID_LABEL		= "Invalid Label!";
static const char * ERR_INVALID_VALUE		= "Invalid value!";
static const char * ERR_INVALID_PARAMETER	= "Invalid parameter!";
static const char * ERR_INVALID_OPERATION	= "Invalid operation!";
static const char * ERR_DUPLICATE_SYMBOL	= "Duplicate symbol!";
static const char * ERR_NO_SYMBOL			= "Symbol is not exists!";
static const char * ERR_NO_XE				= "XE needed!";

extern int retvalue;
inline void Error(const char * str)
{
	cout << "Error : " << str << endl;
	retvalue = -1;
}

template < class T >
inline void W(ostream & o, const T & v, int s = TEXT_LENGTH)
{
	o << DELIM << setw(s) << v;
}

void T(ostream & o, istream & i, int start, int end);
void M(string & s, int loc, int size, char c, const string & param);
void E(string & s, int loc);
string S(const string & s);

#endif
